/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mycompany.mqdemo3;

import iie.mm.client.ClientAPI;

public class MMDemo {

    //全局变量
    private static ClientAPI ca = new ClientAPI();

    public static void main(String[] args) {

        try {
//            ca.init("STL://192.168.11.94:26378", "SJJH");//初始化客户端
            ca.init("STL://192.168.11.94:26378", "SJJH");//初始化客户端
            {
                //其他逻辑
            }
//            String key = ca.uploadFile("/tmp/test.jpg");//上传文件,参数是文件路径,返回key用来查询
            String key = ca.uploadFile("D:\\a\\c\\1233.jpg");//上传文件,参数是文件路径,返回key用来查询
            System.out.println(key);

            byte[] content = ca.downloadFile(key, 0, -1);//从偏移offset读取长度为length的数据,若一次读取整个小文件则把len参数设为-1

        } catch (Exception e) {
            e.printStackTrace();
        }

        ca.quit();//程序退出调用
    }

    //HTTP接口 192.168.11.96:20099/get?key=
}
